import request from '@/utils/request'

// 查询任务企业抽取规则列表
export function listRules(query) {
  return request({
    url: '/task/rules/list',
    method: 'get',
    params: query
  })
}

// 查询任务企业抽取规则详细
export function getRules(id) {
  return request({
    url: '/task/rules/' + id,
    method: 'get'
  })
}

// 新增任务企业抽取规则
export function addRules(data) {
  return request({
    url: '/task/rules',
    method: 'post',
    data: data
  })
}

// 修改任务企业抽取规则
export function updateRules(data) {
  return request({
    url: '/task/rules',
    method: 'put',
    data: data
  })
}

// 删除任务企业抽取规则
export function delRules(id) {
  return request({
    url: '/task/rules/' + id,
    method: 'delete'
  })
}

// 导出任务企业抽取规则
export function exportRules(query) {
  return request({
    url: '/task/rules/export',
    method: 'get',
    params: query
  })
}

//获取所有对象数量
export function receiveObjectNum(){
  return request({
    url: '/task/rules/getAllObjectNum',
    method: 'get'
  })
}

// 修改启用状态
export function changeUseStatus(ruleId,useStatus) {
  return request({
    url: '/task/rules/' + ruleId+'/'+useStatus,
    method: 'put'
  })
}

export function getStationList(){
  return request({
    url: '/task/rules/getStationList',
    method: 'get'
  })
}

export function getCheckedList(type,id){
  return request({
    url: '/task/rules/getCheckedList/'+type+'/'+id,
    method: 'get'
  })
}
